<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
    Document   : cadastrarProduto
    Created on : 01 nov 2011, 11:17:59
    Author     : vinicius
-->
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:fn="http://java.sun.com/jsp/jstl/functions">


    <ui:composition template="template.xhtml">
        <ui:define name="title"><h:outputText value="Lista dos Voos Disponíveis" /></ui:define>
        <ui:define name="body">
                        <br></br><br></br><br></br><br></br><br></br>
                
                         <div id="datascroller">
                        <h:form>
                   
                    <a4j:outputPanel ajaxRendered="true">
                        <rich:dataScroller for="tarefas" maxPages="10" />		
                        
                        <rich:dataTable id="tarefas" rows="5" 
                                        value="#{vooBusiness.todosVoos}" var="voo">
                            <f:facet name="header">
                                <rich:columnGroup>
                                    <h:column>
                                <h:outputText value="#{msgs['num.voo']}" />
                            </h:column>
                            <h:column>
                                <h:outputText value="#{msgs['localOrigem.voo']}" />
                            </h:column>
                            <h:column>
                                <h:outputText value="#{msgs['localDestino.voo']}" />
                            </h:column>
                            <h:column>
                                <h:outputText value="#{msgs['dataVoo.voo']}" />
                            </h:column>
                            <h:column>
                                <h:outputText value="#{msgs['horaVoo.voo']}" />
                            </h:column>
                            <h:column>
                                <h:outputText value="#{msgs['capacidade.voo']}" />
                            </h:column>
                            <h:column>
                                <h:commandLink value="#{msgs['voo.reservar']}?" />
                            </h:column>
                                </rich:columnGroup>
                            </f:facet>

                            <h:column>
                                <h:outputText value="#{voo.numVoo}" />
                            </h:column>
                            <h:column>
                                <h:outputText value="#{voo.localOrigem}" />
                            </h:column>
                            <h:column>
                                <h:outputText value="#{voo.localDestino}" />
                            </h:column>
                            <h:column>
                                <h:outputText value="#{voo.data}" />
                            </h:column>
                            <h:column>
                                <h:outputText value="#{voo.hora}" />
                            </h:column>
                            <h:column>
                                <h:outputText value="#{voo.capacidade}" />
                            </h:column>
                            <h:column>
                                <h:commandLink value="Reservar" action="#{reservaBusiness.salvarReserva(voo.numVoo, usuarioBusiness.usuario.id)}"/>
                            </h:column>
                        </rich:dataTable>

                        <rich:dataScroller for="tarefas" maxPages="10" />
                        
                    </a4j:outputPanel>
                    
                </h:form>
                        </div>
        </ui:define>
    </ui:composition>
</html>
